/**
 *  自定义错误
 */
export function EasyjError(code, message) {
  var instance = new Error(message)
  instance.name = 'EasyjError'
  instance.code = code
  Object.setPrototypeOf(instance, Object.getPrototypeOf(this))
  if (Error.captureStackTrace) {
    Error.captureStackTrace(instance, EasyjError)
  }
  return instance
}
EasyjError.prototype = Object.create(Error.prototype, {
  constructor: {
    value: Error,
    enumerable: false,
    writable: true,
    configurable: true
  }
})

EasyjError.prototype.constructor = EasyjError
